feat(FR-2608): Vite production build with vite-plugin-pwa service worker#6873
Merged
graphite-app[bot] merged 1 commit intomainfrom Apr 30, 2026
Conversation
3 tasks
3 tasks
Contributor
Author
This was referenced Apr 22, 2026
Merged
Contributor
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 8.11% | 1858/22905 |
| 🔴 | Branches | 7.35% | 1187/16156 |
| 🔴 | Functions | 4.81% | 296/6154 |
| 🔴 | Lines | 7.88% | 1749/22190 |
Test suite run success
865 tests passing in 40 suites.
Report generated by 🧪jest coverage report action from 5dddc64
This was referenced Apr 27, 2026
5c37f96 to
5b738cf
Compare
e36eac7 to
282a1ad
Compare
This was referenced Apr 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces production vite build support for the React WebUI, including generating a Workbox-based service worker via vite-plugin-pwa, and adjusts the HTML transform pipeline so the project-root index.html remains the authoritative template.
Changes:
- Add
vite-plugin-pwa(GenerateSW strategy) to producebuild/sw.jsand workbox runtime assets. - Make
transformIndexHtmldev/build-aware while always operating on the project-rootindex.html(preserving{{nonce}}in production builds). - Add a minimal
react/index.htmlstub entry and avite:buildscript inreact/package.json.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| react/vite.config.ts | Adds VitePWA SW generation and updates transformIndexHtml to use the project-root HTML template consistently. |
| react/package.json | Adds vite:build script and vite-plugin-pwa dev dependency. |
| react/index.html | Adds a Vite entry stub HTML (actual content replaced by projectRootStaticPlugin). |
| react/VITE_POC_NOTES.md | Updates PoC notes to document production build + SW generation behavior. |
| pnpm-lock.yaml | Locks new vite-plugin-pwa dependency and transitive additions. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
5b738cf to
3a0179a
Compare
282a1ad to
2700534
Compare
3a0179a to
b404929
Compare
2700534 to
6b87d63
Compare
b404929 to
d068319
Compare
aa6796c to
98ef760
Compare
d068319 to
2c4b344
Compare
2c4b344 to
a2b2a81
Compare
98ef760 to
8718eb8
Compare
This was referenced Apr 30, 2026
Merge activity
|
…ker (#6873) Resolves #6811(FR-2608) ## Summary Production build via Vite + `vite-plugin-pwa` service worker. This is the point where `vite build` produces a complete deployable `build/` directory. **Build output** (new layout): - `build/index.html` — built from project-root `index.html` via the `transformIndexHtml` hook - `build/assets/*.js` — hashed chunks (Vite default) - `build/sw.js` — service worker generated by `vite-plugin-pwa` (generateSW strategy) - `build/workbox-*.js` — workbox runtime **PWA plugin options** mirror the craco-era `workbox-webpack-plugin` GenerateSW call (`craco.config.cjs:390-400`): - `strategies: 'generateSW'` + `filename: 'sw.js'` - `injectRegister: false` — the existing registration script in `index.html:126-131` stays in charge (preserves legacy behaviour; we do not opt into `registerType: 'autoUpdate'`). - `skipWaiting: true`, `clientsClaim: true` - `maximumFileSizeToCacheInBytes: 5 MiB` - `globIgnores: ['**/*.map', '**/asset-manifest.json']` ## Test plan - [x] `pnpm run vite:build` completes without errors - [x] `build/sw.js` generated, precaches ~460 entries (~22 MB) - [x] SW registration path in `index.html` still resolves ## Follow-up (PR #6877) The plugin also emits `manifest.webmanifest` by default, which competes with the repo's own `manifest.json`. That's disabled in the follow-up `fix(FR-2608)` PR further up the stack. ## Stack Builds on FR-2610.
a2b2a81 to
19e4114
Compare
8718eb8 to
5dddc64
Compare
Base automatically changed from
04-20-feat_fr-2610_vite_dev-reload_plugin_for_i18n___theme___config.toml_file_changes
to
main
April 30, 2026 12:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Resolves #6811(FR-2608)
Summary
Production build via Vite +
vite-plugin-pwaservice worker. This is the point wherevite buildproduces a complete deployablebuild/directory.Build output (new layout):
build/index.html— built from project-rootindex.htmlvia thetransformIndexHtmlhookbuild/assets/*.js— hashed chunks (Vite default)build/sw.js— service worker generated byvite-plugin-pwa(generateSW strategy)build/workbox-*.js— workbox runtimePWA plugin options mirror the craco-era
workbox-webpack-pluginGenerateSW call (craco.config.cjs:390-400):strategies: 'generateSW'+filename: 'sw.js'injectRegister: false— the existing registration script inindex.html:126-131stays in charge (preserves legacy behaviour; we do not opt intoregisterType: 'autoUpdate').skipWaiting: true,clientsClaim: truemaximumFileSizeToCacheInBytes: 5 MiBglobIgnores: ['**/*.map', '**/asset-manifest.json']Test plan
pnpm run vite:buildcompletes without errorsbuild/sw.jsgenerated, precaches ~460 entries (~22 MB)index.htmlstill resolvesFollow-up (PR #6877)
The plugin also emits
manifest.webmanifestby default, which competes with the repo's ownmanifest.json. That's disabled in the follow-upfix(FR-2608)PR further up the stack.Stack
Builds on FR-2610.